<?php
namespace App\Http\Controllers\Home;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
class WxController extends Controller{
    function __construct() {
        $this->appid  = getenv('APPID');
        $this->secret = getenv('AppSecret');
    }
    //获取access_token
    public function getWxToken(){
        $token = getWxToken();
        dd($token);
            
    }
    
    public function getOpenId(Request $request){
        $code = $request->get('code');
        $data = getOpenId($code,$this->appid,$this->secret);
        return $data;
    }
}


